<!DOCTYPE html>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css">
<title>Captive</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>


<script>

	var init = 5;
	
	$(document).ready(
		function() {
			document.getElementById("dialog").style.display="inherit";
			document.getElementById("background").style.display="inherit";
			document.getElementById("dialog").innerHTML = "(At home. Two hours after the incident.)";
			$("#dialog").click(dialog1);
		}
	);
	
	function dialog1()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/police.png";
		document.getElementById("dialog").innerHTML = "Policeman says: <br/>We will contact you to gather more information if needed, Mr. Jackson.";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2);
		}
	}
	
	function dialog2()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "I say: <br/>Anytime. Let me know if I can help.";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog3);
		}
	}
	
	function dialog3()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(Policeman leaves the house)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog4);
		}
	}
	
	function dialog4()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(Silence. Jimmy is sitting next to me. Not talking.)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog5);
		}
	}
	
	function dialog5()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I say: <br/>Jimmy, you wanna grab something to eat?";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog6);
		}
	}
	
	function dialog6()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(Jimmy gets up and heads toward his room)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog7);
		}
	}
	
	function dialog7()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I say: <br/>Jimmy, I was talking to you!";
		setTimeout(bind_click, 3000);
		function bind_click(){
			$("#dialog").click(dialog8);
		}
	}
	
	function dialog8()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>I rather talk to Stephen than you.";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog9);
		}
	}
	
	function dialog9()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "(Jimmy goes to his room and shuts the door behind him)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog10);
		}
	}
	
	function dialog10()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "GOSH!! Why can't he be more mature??!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog11);
		}
	}
	
	function dialog11()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "It's all Stephen's fault! He turned Jimmy against me!!.....";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog12);
		}
	}
	
	function dialog12()
	{
		$("#dialog").unbind('click');
		$("#dialog").fadeOut(5000,nextscene);
	}
	
	
	
	function nextscene()
	{
			window.location = "theend.php";
	}
	
	
</script>



</head>

<body>


<div id="container">
	<div id="background"><img src="images/home.jpg" /></div>
	<div id="dialog">
	</div>
	<div id="people"><img id="peopleimage" src=""></div>
</div>




</body>
</html>